<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
  <title>service_uri (OpenSocial::Connection)</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
</head>
<body class="standalone-code">
  <pre><span class="ruby-comment cmt"># File lib/opensocial/connection.rb, line 118</span>
    <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">service_uri</span>(<span class="ruby-identifier">service</span>, <span class="ruby-identifier">guid</span>, <span class="ruby-identifier">selector</span>, <span class="ruby-identifier">pid</span>)
      <span class="ruby-identifier">uri</span> = [<span class="ruby-ivar">@container</span>[<span class="ruby-identifier">:endpoint</span>], <span class="ruby-identifier">service</span>, <span class="ruby-identifier">guid</span>, <span class="ruby-identifier">selector</span>, <span class="ruby-identifier">pid</span>].<span class="ruby-identifier">compact</span>.
              <span class="ruby-identifier">join</span>(<span class="ruby-value str">'/'</span>)
      
      <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@auth</span> <span class="ruby-operator">==</span> <span class="ruby-constant">AUTH_HMAC</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">xoauth_requestor_id</span>.<span class="ruby-identifier">empty?</span>
        <span class="ruby-identifier">uri</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">'?xoauth_requestor_id='</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@xoauth_requestor_id</span>
      <span class="ruby-keyword kw">elsif</span> <span class="ruby-ivar">@auth</span> <span class="ruby-operator">==</span> <span class="ruby-constant">AUTH_ST</span>
        <span class="ruby-identifier">uri</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">'?st='</span> <span class="ruby-operator">+</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">st</span>
      <span class="ruby-keyword kw">end</span>
      <span class="ruby-constant">URI</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">uri</span>)
    <span class="ruby-keyword kw">end</span></pre>
</body>
</html>